#include"RBTree.h"
#include"AVLTree.h"
#include<vector>

int main()
{
	RBTree<int, int> rbt;
	vector<int>v;
	const int N = 100000;
	srand(time(0));
	//int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	//int a[] = { 4, 2, 63, 11111, 399999, 5, 15, -7, 16, 14 };
	//for (auto e : a)
	//{
	//	if (e == 14)
	//	{
	//		int x=100;
	//	}
	//	t.insert(make_pair(e, e));
	//	//cout << e << "->" << t.isBalance()<< endl;
	//}
	for (int i = 0; i < N; i++)
	{
		v.push_back(rand());
	}

	for (auto e : v)
	{
		rbt.insert(make_pair(e, e));
	}

	rbt.isBalance();
	cout << rbt.Height() << endl;
	

	AVLTree<int, int> avlt;
	for (auto e : v)
	{
		avlt.insert(make_pair(e,e));
	}

	cout << avlt.GetHeight() << endl;

	return 0;
}